package com.walker.spring.main;

import com.walker.spring.config.AspectConfig;
import com.walker.spring.service.DemoAnnotationService;
import com.walker.spring.service.DemoMethodService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 运行
 *
 * @author qinmu
 * @create 2017-10-14-12:13
 */
public class AopMain {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AspectConfig.class);
        DemoAnnotationService demoAnnotationService = context.getBean(DemoAnnotationService.class);
        demoAnnotationService.add();
        DemoMethodService methodService = context.getBean(DemoMethodService.class);
        methodService.add();
        context.close();
    }

}
